Shelley wrote Ozymandias in competition with his friend Horace Smith. According to Wikipedia, sonnet–writing competitions were not uncommon at the time. Shelley's version was published in The Examiner (a leading intellectual journal of the time, founded in 1808 by Leigh and John Hunt) on 11 January 1818, and Smith's a week later.
Nobody seems to know who won the competition!
Horace Smith was a successful stockbroker, as well as a poet and novelist. Shelley said of him, "Is it not odd that the only truly generous person I ever knew who had money enough to be generous with should be a stockbroker? He writes poetry and pastoral dramas and yet knows how to make money, and does make it, and is still generous."
© Haydn Thompson 2021